/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mrp.productionPlanning.managedbean;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.PhaseEvent;
import mrp.productionPlanning.entity.DailyDetailEntity;
import mrp.productionPlanning.entity.MPSTableEntity;
import mrp.productionPlanning.entity.MonthlyDetailEntity;
import mrp.productionPlanning.session.DailyDetailSessionBean;
import mrp.productionPlanning.session.MPSTableSessionBean;
import mrp.productionPlanning.session.MonthlyDetailSessionBean;
import org.primefaces.event.FlowEvent;
import scm.inventoryControl.session.stateless.InventoryControlSessionBean;

/**
 *
 * @author Wei Haoyang
 */
@ManagedBean
@ViewScoped
public class EditMPSTableManagedBean {

    private boolean skip;
    private static Logger logger = Logger.getLogger(EditMPSTableManagedBean.class.getName());
    private List<MPSTableEntity> mpsListA; // = new ArrayList<MPSTableEntity>();
    private List<MPSTableEntity> mpsListB;// = new ArrayList<MPSTableEntity>();
    private List<MPSTableEntity> mpsListC;// = new ArrayList<MPSTableEntity>();
    private List<MPSTableEntity> mpsListD;// = new ArrayList<MPSTableEntity>();
    private String title;
    private int yearName;
    @EJB
    private MPSTableSessionBean mpsTableSessionBean = new MPSTableSessionBean();
    @EJB
    private InventoryControlSessionBean icsb = new InventoryControlSessionBean();
    @EJB
    private MPSTableSessionBean mpsb = new MPSTableSessionBean();
    @EJB
    private MonthlyDetailSessionBean mdsb = new MonthlyDetailSessionBean();
    @EJB
    private DailyDetailSessionBean ddsb = new DailyDetailSessionBean();

    /** Creates a new instance of EditMPSTableManagedBean */
    public EditMPSTableManagedBean() {
//        mpsListA = new ArrayList<MPSTableEntity>();
//        mpsListB = new ArrayList<MPSTableEntity>();
//        mpsListC = new ArrayList<MPSTableEntity>();
//        mpsListD = new ArrayList<MPSTableEntity>();
        yearName = 0;
    }

    public void initView(PhaseEvent event) {
            Calendar cal = new GregorianCalendar();
            if (mpsListA == null) {
                setMpsListA((List<MPSTableEntity>) FacesContext.getCurrentInstance().getExternalContext().getFlash().get("mpsListA"));
                System.out.println("ListASize: " + mpsListA.size());
            }
            if (mpsListB == null){    
                setMpsListB((List<MPSTableEntity>) FacesContext.getCurrentInstance().getExternalContext().getFlash().get("mpsListB"));
                System.out.println("ListBSize: " + mpsListB.size());
            }
            if (mpsListC == null){
                setMpsListC((List<MPSTableEntity>) FacesContext.getCurrentInstance().getExternalContext().getFlash().get("mpsListC"));
                System.out.println("ListCSize: " + mpsListC.size());
            }
            if (mpsListD == null){
                setMpsListD((List<MPSTableEntity>) FacesContext.getCurrentInstance().getExternalContext().getFlash().get("mpsListD"));
                System.out.println("ListDSize: " + mpsListD.size());
            }
            if (yearName == 0) {
                cal.setTime(mpsListA.get(0).getMonth());
                yearName = cal.get(Calendar.YEAR);
            }
//            System.out.println(mpsListA.get(0).getMonth().toString());
//            System.out.println(yearName);
            setTitle("MPS for Year " + yearName);
    }

    public void updateFormA(ActionEvent event) {
        Calendar cal = new GregorianCalendar();
        float a[] = new float[12];
        boolean b[] = new boolean[12];
        boolean c = true;
        for (MPSTableEntity mps:mpsListA){
            mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mps.getWorkingDay())));
        }
        for (int j = 0; j < mpsListA.size(); j++){
            a[j] = mpsListA.get(j).getUtilRate()+mpsListB.get(j).getUtilRate()+mpsListC.get(j).getUtilRate()+mpsListD.get(j).getUtilRate();
            System.out.println("Month: "+j + "  UtilRate: "+ a[j]);
        }
        for (int k = 0; k < mpsListA.size(); k++){
            System.out.println("Check Month Value: "+a[k]);
            if (a[k] >1){
                b[k] = true;
                c = false;
                System.out.println("Month: "+ k + "   Valide: " + b[k]);
                System.out.println("shouldPass? : " + c);
            }
        }
        System.out.println("Final Should Pass: "+c);
        int currentInventory = icsb.getCurrentInventoryLevel("Classic Nutri Bar-Nuts");
        if (c){
            for (MPSTableEntity mps : mpsListA) {
                if (mps.getMonthName().equalsIgnoreCase("Jan")) {
                    mps.setInventory(currentInventory - mps.getForecastEntity().getAmountA() + mps.getMonthlyDetailEntity().getScheduleA());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                    System.out.println("Inventory: " + mps.getInventory());
                } else {
                    System.out.println("********************************************************************");
                    Date lastMonth = mps.getMonth();
                    cal.setTime(lastMonth);
                    int cm = 0;
                    System.out.println("CurrentMonth: "+lastMonth.toString());
                    cm = cal.get(Calendar.MONTH);
                    cm -= 1;
                    cal.set(Calendar.MONTH, cm);
                    lastMonth = cal.getTime();
                    System.out.println("LastMonth: " + lastMonth.toString());
                    MPSTableEntity lastMPS = mpsb.getMPSTableByDate(lastMonth, "productA");
                    System.out.println("LastMonthInv: "+ lastMPS.getInventory());
                    mps.setInventory(lastMPS.getInventory() - mps.getForecastEntity().getAmountA() + mps.getMonthlyDetailEntity().getScheduleA());
                    System.out.println("Inventory: " + mps.getInventory()); 
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mps.getWorkingDay())));
                    System.out.println(mps.getMonthlyDetailEntity().getScheduleA());
                    System.out.println(mps.getMonthlyDetailEntity().getScheduleB());
                    System.out.println(mps.getMonthlyDetailEntity().getScheduleC());
                    System.out.println(mps.getMonthlyDetailEntity().getScheduleD());
                    System.out.println(mps.getUtilRate());
                    mpsb.updateMPSTable(mps);
                }
            }
        }
        else {
            System.out.append("Rejected!");
            StringBuilder sb = new StringBuilder();
            sb.append("These months has a exceeded maximum capacity: ");
            for (int i = 0; i<11; i++){
                int k = i+1;
                if(b[i]){
                    sb.append(" "+ k + ",");
                }
            }
            if (b[11]){
                sb.append(" "+ 12 + ".");
            }
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, sb.toString(), ""));
        }
    }

    public void updateFormB(ActionEvent event) {
        Calendar cal = new GregorianCalendar();
        int currentInventory = icsb.getCurrentInventoryLevel("Classic Nutri Bar-Nuts");
        float a[] = new float[12];
        boolean b[] = new boolean[12];
        boolean c = true;
        for (MPSTableEntity mps:mpsListB){
            mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mps.getWorkingDay())));
        }
        for (int j = 0; j < mpsListA.size(); j++){
            a[j] = mpsListA.get(j).getUtilRate()+mpsListB.get(j).getUtilRate()+mpsListC.get(j).getUtilRate()+mpsListD.get(j).getUtilRate();
            System.out.println("Month: "+j + "  UtilRate: "+ a[j]);
        
        }
        for (int k = 0; k < mpsListA.size(); k++){
            System.out.println("Check Month Value: "+a[k]);
            if (a[k] >1){
                b[k] = true;
                c = false;
                System.out.println("Month: "+ k + "   Valide: " + b[k]);
                System.out.println("shouldPass? : " + c);
            }
        }
        System.out.println("Final Should Pass: "+c);
        if (c){
            for (MPSTableEntity mps : mpsListB) {
                if (mps.getMonthName().equalsIgnoreCase("Jan")) {
                    mps.setInventory(currentInventory - mps.getForecastEntity().getAmountB() + mps.getMonthlyDetailEntity().getScheduleB());
                    System.out.println("Inventory: " + mps.getInventory());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleB()/50)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                } else {
                    Date lastMonth = mps.getMonth();
                    cal.setTime(lastMonth);
                    int cm = 0;
                    System.out.println(lastMonth.toString());
                    cm = cal.get(Calendar.MONTH);
                    cm -= 1;
                    cal.set(Calendar.MONTH, cm);
                    lastMonth = cal.getTime();
                    System.out.println("LastMonth:" + lastMonth.toString());
                    MPSTableEntity lastMPS = mpsb.getMPSTableByDate(lastMonth, "productB");
                    mps.setInventory(lastMPS.getInventory() - mps.getForecastEntity().getAmountB() + mps.getMonthlyDetailEntity().getScheduleB());
                    System.out.println("Inventory: " + mps.getInventory());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleB()/50)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                }
            }
        }
        else {
            System.out.append("Rejected!");
            StringBuilder sb = new StringBuilder();
            sb.append("These months has a exceeded maximum capacity: ");
            for (int i = 0; i<11; i++){
                int k = i+1;
                if(b[i]){
                    sb.append(" "+ k + ",");
                }
            }
            if (b[11]){
                sb.append(" "+ 12 + ".");
            }
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, sb.toString(), ""));
        }
    }

    public void updateFormC(ActionEvent event) {
        Calendar cal = new GregorianCalendar();
        int currentInventory = icsb.getCurrentInventoryLevel("Classic Nutri Bar-Nuts");
        float a[] = new float[12];
        boolean b[] = new boolean[12];
        boolean c = true;
        for (MPSTableEntity mps:mpsListC){
            mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mps.getWorkingDay())));
        }
        for (int j = 0; j < mpsListA.size(); j++){
            a[j] = mpsListA.get(j).getUtilRate()+mpsListB.get(j).getUtilRate()+mpsListC.get(j).getUtilRate()+mpsListD.get(j).getUtilRate();
            System.out.println("Month: "+j + "  UtilRate: "+ a[j]);
        
        }
        for (int k = 0; k < mpsListA.size(); k++){
            System.out.println("Check Month Value: "+a[k]);
            if (a[k] >1){
                b[k] = true;
                c = false;
                System.out.println("Month: "+ k + "   Valide: " + b[k]);
                System.out.println("shouldPass? : " + c);
            }
        }
        System.out.println("Final Should Pass: "+c);
        if (c){
            for (MPSTableEntity mps : mpsListC) {
                if (mps.getMonthName().equalsIgnoreCase("Jan")) {
                    mps.setInventory(currentInventory - mps.getForecastEntity().getAmountC() + mps.getMonthlyDetailEntity().getScheduleC());
                    System.out.println("Inventory: " + mps.getInventory());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleC()/45)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                } else {
                    Date lastMonth = mps.getMonth();
                    cal.setTime(lastMonth);
                    int cm = 0;
                    System.out.println(lastMonth.toString());
                    cm = cal.get(Calendar.MONTH);
                    cm -= 1;
                    cal.set(Calendar.MONTH, cm);
                    lastMonth = cal.getTime();
                    System.out.println("LastMonth:" + lastMonth.toString());
                    MPSTableEntity lastMPS = mpsb.getMPSTableByDate(lastMonth, "productC");
                    mps.setInventory(lastMPS.getInventory() - mps.getForecastEntity().getAmountC() + mps.getMonthlyDetailEntity().getScheduleC());
                    System.out.println("Inventory: " + mps.getInventory());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleC()/45)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                }
            }
        }
        else {
            System.out.append("Rejected!");
            StringBuilder sb = new StringBuilder();
            sb.append("These months has a exceeded maximum capacity: ");
            for (int i = 0; i<11; i++){
                int k = i+1;
                if(b[i]){
                    sb.append(" "+ k + ",");
                }
            }
            if (b[11]){
                sb.append(" "+ 12 + ".");
            }
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, sb.toString(), ""));
        }
    }

    public void updateFormD(ActionEvent event) {
        Calendar cal = new GregorianCalendar();
        int currentInventory = icsb.getCurrentInventoryLevel("Classic Nutri Bar-Nuts");
        float a[] = new float[12];
        boolean b[] = new boolean[12];
        boolean c = true;
        for (MPSTableEntity mps:mpsListD){
            mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mps.getWorkingDay())));
        }
        for (int j = 0; j < mpsListA.size(); j++){
            a[j] = mpsListA.get(j).getUtilRate()+mpsListB.get(j).getUtilRate()+mpsListC.get(j).getUtilRate()+mpsListD.get(j).getUtilRate();
            System.out.println("Month: "+j + "  UtilRate: "+ a[j]);
        
        }
        for (int k = 0; k < mpsListA.size(); k++){
            System.out.println("Check Month Value: "+a[k]);
            if (a[k] >1){
                b[k] = true;
                c = false;
                System.out.println("Month: "+ k + "   Valide: " + b[k]);
                System.out.println("shouldPass? : " + c);
            }
        }
        System.out.println("Final Should Pass: "+c);
        if(c){
            for (MPSTableEntity mps : mpsListD) {
                if (mps.getMonthName().equalsIgnoreCase("Jan")) {
                    mps.setInventory(currentInventory - mps.getForecastEntity().getAmountD() + mps.getMonthlyDetailEntity().getScheduleD());
                    System.out.println("Inventory: " + mps.getInventory());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleD()/45)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                } else {
                    Date lastMonth = mps.getMonth();
                    cal.setTime(lastMonth);
                    int cm = 0;
                    System.out.println(lastMonth.toString());
                    cm = cal.get(Calendar.MONTH);
                    cm -= 1;
                    cal.set(Calendar.MONTH, cm);
                    lastMonth = cal.getTime();
                    System.out.println("LastMonth:" + lastMonth.toString());
                    MPSTableEntity lastMPS = mpsb.getMPSTableByDate(lastMonth, "productD");
                    mps.setInventory(lastMPS.getInventory() - mps.getForecastEntity().getAmountD() + mps.getMonthlyDetailEntity().getScheduleD());
                    System.out.println("Inventory: " + mps.getInventory());
                    mps.setUtilRate((float)((mps.getMonthlyDetailEntity().getScheduleD()/45)/(21.6*mps.getWorkingDay())));
                    mpsb.updateMPSTable(mps);
                }
            }
        }
        else {
            System.out.append("Rejected!");
            StringBuilder sb = new StringBuilder();
            sb.append("These months has a exceeded maximum capacity: ");
            for (int i = 0; i<11; i++){
                int k = i+1;
                if(b[i]){
                    sb.append(" "+ k + ",");
                }
            }
            if (b[11]){
                sb.append(" "+ 12 + ".");
            }
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, sb.toString(), ""));
        }
    }

    public void save(ActionEvent event) {
        MonthlyDetailEntity month = new MonthlyDetailEntity();
//        List<MonthlyDetailEntity> monthA = new ArrayList<MonthlyDetailEntity>();
//        List<MonthlyDetailEntity> monthB = new ArrayList<MonthlyDetailEntity>();
//        List<MonthlyDetailEntity> monthC = new ArrayList<MonthlyDetailEntity>();
//        List<MonthlyDetailEntity> monthD = new ArrayList<MonthlyDetailEntity>();
//        for (int i = 0; i < mpsListA.size(); i++) {
//            mpsTableSessionBean.updateMPSTable(mpsListA.get(i));
//            for (MonthlyDetailEntity month: monthA){
//                mdsb.updateMonthlyDetail(month);
//            }
//            mpsTableSessionBean.updateMPSTable(mpsListB.get(i));
//            for (MonthlyDetailEntity month: monthB){
//                mdsb.updateMonthlyDetail(month);
//            }
//            mpsTableSessionBean.updateMPSTable(mpsListC.get(i));
//            for (MonthlyDetailEntity month: monthC){
//                mdsb.updateMonthlyDetail(month);
//            }
//            mpsTableSessionBean.updateMPSTable(mpsListD.get(i));
//            for (MonthlyDetailEntity month: monthD){
//                mdsb.updateMonthlyDetail(month);
//            }
//        }
//        for (MPSTableEntity mps : mpsListA){
//            month = mps.getMonthlyDetailEntity();
//            System.out.println(mps.getMonthlyDetailEntity().getScheduleA());
//            month.setScheduleA(mps.getMonthlyDetailEntity().getScheduleA());
////            mdsb.updateMonthlyDetail(month);
//            mpsb.updateMPSTable(mps);
//            System.out.println(mps.getMonthlyDetailEntity().getId());
////            System.out.println(mps.getMonthlyDetailEntity().getScheduleA());
//            
//        }
//        for (MPSTableEntity mps : mpsListB){
//            month = mps.getMonthlyDetailEntity();
//            System.out.println(mps.getMonthlyDetailEntity().getScheduleB());
//            month.setScheduleB(mps.getMonthlyDetailEntity().getScheduleB());
//            
////            mdsb.updateMonthlyDetail(month);
//            mpsb.updateMPSTable(mps);
//            System.out.println(mps.getMonthlyDetailEntity().getId());
////            System.out.println(mps.getMonthlyDetailEntity().getScheduleB());
//        }
//        for (MPSTableEntity mps : mpsListC){
//            month = mps.getMonthlyDetailEntity();
//            System.out.println(mps.getMonthlyDetailEntity().getScheduleC());
//            month.setScheduleC(mps.getMonthlyDetailEntity().getScheduleC());
////            mdsb.updateMonthlyDetail(month);
//            mpsb.updateMPSTable(mps);
//            System.out.println(mps.getMonthlyDetailEntity().getId());
////            System.out.println(mps.getMonthlyDetailEntity().getScheduleC());
//        }
//        for (MPSTableEntity mps : mpsListD){
//            month = mps.getMonthlyDetailEntity();
//            System.out.println(mps.getMonthlyDetailEntity().getScheduleD());
//            month.setScheduleD(mps.getMonthlyDetailEntity().getScheduleD());
////            mdsb.updateMonthlyDetail(month);
//            mpsb.updateMPSTable(mps);
//            System.out.println(mps.getMonthlyDetailEntity().getId());
////            System.out.println(mps.getMonthlyDetailEntity().getScheduleD());
//        }
        float a[] = new float[12];
        boolean b[] = new boolean[12];
        boolean c = true;
        for (int i = 0; i < mpsListA.size(); i++){
            mpsListA.get(i).setUtilRate((float)((mpsListA.get(i).getMonthlyDetailEntity().getScheduleA()/50)/(21.6*mpsListA.get(i).getWorkingDay())));
            mpsListB.get(i).setUtilRate((float)((mpsListB.get(i).getMonthlyDetailEntity().getScheduleB()/50)/(21.6*mpsListB.get(i).getWorkingDay())));
            mpsListC.get(i).setUtilRate((float)((mpsListC.get(i).getMonthlyDetailEntity().getScheduleC()/50)/(21.6*mpsListC.get(i).getWorkingDay())));
            mpsListD.get(i).setUtilRate((float)((mpsListD.get(i).getMonthlyDetailEntity().getScheduleD()/50)/(21.6*mpsListD.get(i).getWorkingDay())));
        }
        for (int j = 0; j < mpsListA.size(); j++){
            a[j] = mpsListA.get(j).getUtilRate()+mpsListB.get(j).getUtilRate()+mpsListC.get(j).getUtilRate()+mpsListD.get(j).getUtilRate();
            System.out.println("Month: "+j + "  UtilRate: "+ a[j]);
        
        }
        for (int k = 0; k < mpsListA.size(); k++){
            System.out.println("Check Month Value: "+a[k]);
            if (a[k] >1){
                b[k] = true;
                c = false;
                System.out.println("Month: "+ k + "   Valide: " + b[k]);
                System.out.println("shouldPass? : " + c);
            }
        }
        System.out.println("Final Should Pass: "+c);
        if (c){
            System.out.append("Proceed to Save");
            for (int i = 0; i< mpsListA.size(); i++){
                mpsb.updateMPSTable(mpsListA.get(i));
                mpsb.updateMPSTable(mpsListB.get(i));
                mpsb.updateMPSTable(mpsListC.get(i));
                mpsb.updateMPSTable(mpsListD.get(i));
                month = mpsListA.get(i).getMonthlyDetailEntity();
                month.setScheduleA(mpsListA.get(i).getMonthlyDetailEntity().getScheduleA());
                month.setScheduleB(mpsListB.get(i).getMonthlyDetailEntity().getScheduleB());
                month.setScheduleC(mpsListC.get(i).getMonthlyDetailEntity().getScheduleC());
                month.setScheduleD(mpsListD.get(i).getMonthlyDetailEntity().getScheduleD());
                mdsb.updateMonthlyDetail(month);
            }
            boolean newDay = true;
            for (DailyDetailEntity day:ddsb.getAllDays()){
                if (day.getScheduleA() != 0 || day.getScheduleB() != 0 || day.getScheduleC() != 0 || day.getScheduleD() != 0){
                    newDay = false;
                }
            }
            if (newDay){
                ddsb.initiateValue();
            }
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "MPS is Successfully Done.", ""));
            System.out.println("*******************************************************************");
        }
        else {
            System.out.append("Rejected!");
            StringBuilder sb = new StringBuilder();
            sb.append("These months has a exceeded maximum capacity: ");
            for (int i = 0; i<11; i++){
                int k = i+1;
                if(b[i]){
                    sb.append(" "+ k + ",");
                }
            }
            if (b[11]){
                sb.append(" "+ 12 + ".");
            }
            FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, sb.toString(), ""));
        }
    }

    public String onFlowProcess(FlowEvent event) {
        logger.info("Current wizard step:" + event.getOldStep());
        logger.info("Next step:" + event.getNewStep());

        if (skip) {
            skip = false;   //reset in case user goes back  
            return "confirm";
        } else {
            return event.getNewStep();
        }
    }

    public boolean isSkip() {
        return skip;
    }

    public void setSkip(boolean skip) {
        this.skip = skip;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public MPSTableSessionBean getMpsTableSessionBean() {
        return mpsTableSessionBean;
    }

    public void setMpsTableSessionBean(MPSTableSessionBean mpsTableSessionBean) {
        this.mpsTableSessionBean = mpsTableSessionBean;
    }

    public List<MPSTableEntity> getMpsListA() {
        return mpsListA;
    }

    public void setMpsListA(List<MPSTableEntity> mpsListA) {
        this.mpsListA = mpsListA;
    }

    public List<MPSTableEntity> getMpsListB() {
        return mpsListB;
    }

    public void setMpsListB(List<MPSTableEntity> mpsListB) {
        this.mpsListB = mpsListB;
    }

    public List<MPSTableEntity> getMpsListC() {
        return mpsListC;
    }

    public void setMpsListC(List<MPSTableEntity> mpsListC) {
        this.mpsListC = mpsListC;
    }

    public List<MPSTableEntity> getMpsListD() {
        return mpsListD;
    }

    public void setMpsListD(List<MPSTableEntity> mpsListD) {
        this.mpsListD = mpsListD;
    }

    public static Logger getLogger() {
        return logger;
    }

    public static void setLogger(Logger aLogger) {
        logger = aLogger;
    }
}
